package com.knowno.ui;

import com.knowno.customer.SparkRequest;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

public class QFrame extends  JFrame{
    private JPanel panel1;
    private JTextField textField1;
    private JButton button1;
    private JTextArea textArea1;

    public QFrame() {
        button1.addActionListener(new ActionListener() {
            @Override
            public void actionPerformed(ActionEvent e) {


                textArea1.setText("");
                String s = SparkRequest.sendRequest(textField1.getText());
                textArea1.append(s);
            }
        });
    }

    public static void main(String[] args) {
        QFrame qFrame = new QFrame();
        qFrame.setContentPane(qFrame.panel1);
        qFrame.textArea1.setLineWrap(true);
        qFrame.setVisible(true);

    }
}
